<B:UIGAAUF x:Class="WPFExcelReport.TGD7X3"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
     xmlns:B="clr-namespace:WPFExcelReport;assembly=TGAAUF" 
     xmlns:me="clr-namespace:WPFExcelReport" 
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM" 
     xmlns:ABK="clr-namespace:WPFExcelReport;assembly=TABKOPF"  
    xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"  
    xmlns:GSC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR"  
    xmlns:QR="clr-namespace:WPFExcelReport;assembly=TICC_AV95RULES" 
    xmlns:GC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR" 
     xmlns:G8="clr-namespace:WPFExcelReport;assembly=TGASTGA" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <B:UIGAAUF.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:UPPERGB2312 x:Key="UGB"/>
        <ucd:DateConverter x:Key="date"/>
    </B:UIGAAUF.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>

        <WrapPanel Grid.Row="1" >
            <Grid  Margin="0,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=需求}}"  VerticalAlignment="Center" />
                <TextBlock  Grid.Column="1" Background="White"   Height="Auto"    Width="80"
                         Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100}}"  Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid  Margin="0,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <CheckBox  Grid.Column="0" IsChecked="{Binding IsKG3,ElementName=TV}" Content="外购"/> 
                <ex:NumericBox Grid.Column="1" Background="White"   Height="Auto"    Width="80"
                           Text="{Binding Path=GAKG3,Converter={StaticResource ResourceKey=d100}}" 
                           Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid  Margin="0,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=自产}}"  VerticalAlignment="Center" />
                <ex:NumericBox Grid.Column="1" Background="White"   Height="Auto"    Width="80"
                           Text="{Binding Path=GAKG5,Converter={StaticResource ResourceKey=d100}}" 
                           Margin="15,0,0,0"   VerticalAlignment="Center"/>
            </Grid>
            <Grid Margin="10,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=原料到达日期:}}"/>
                <ex:NumericBox Text="{Binding GADATBIS}" Width="100" />
                <DatePicker Height="30" Grid.Column="1" HorizontalAlignment="Left" Margin="5,0,0,0"   Visibility="Collapsed"
                                 IsEnabled="{Binding IsEdit}" 
                                Text="{Binding DATBIS,ElementName=TV, Converter={StaticResource date}}" FontSize="18"   Width="140" 
                                DisplayDate="{Binding DATBIS,ElementName=TV, Converter={StaticResource date}}"/> 
            </Grid>
        </WrapPanel>
        <DataGrid Grid.Row="2"   
                AutoGenerateColumns="False"  
                  EnableRowVirtualization="False"  
                  Name="dlgMaster"  
                  IsReadOnly="True"
                 ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column" 
                  CanUserReorderColumns="True"
                  CanUserResizeRows="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" 
                  Width="Auto" Height="Auto"
                  EnableColumnVirtualization="True" 
                  HorizontalScrollBarVisibility="Auto"
                  VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Header="" Binding="{Binding GAAUFKRS}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=评估单}}" Binding="{Binding GAAUFLFD}" Width="Auto"/>

                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=纱线}}" Binding="{Binding GAART, Converter={StaticResource ResourceKey=UGB}}" Width="Auto"/> 
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=需求}}" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=自产}}" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=外购}}" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" IsReadOnly="True" Width="Auto"/>                
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=到达日期}}" Binding="{Binding GADATBIS}" Width="Auto"/>
            </DataGrid.Columns> 
        </DataGrid> 
    </Grid>
</B:UIGAAUF>
